-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[POC] implement test_arithmetic.py #22033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@jbrockmendel : So even though this is a POC, you still want to merge this, right? |
If there is consensus about this goal, yes. |
Codecov Report
@@ Coverage Diff @@
## master #22033 +/- ##
==========================================
+ Coverage 92.06% 92.06% +<.01%
==========================================
Files 170 170
Lines 50705 50720 +15
==========================================
+ Hits 46680 46695 +15
Misses 4025 4025
Continue to review full report at Codecov.
|
@jreback related to discussion about test refactoring. |
The idea would be to add the arrays as when they exist? general idea looks good to me |
Yes. Shorter term the idea is focused on de-duplication and testing cases that aren't currently covered for all the relevant classes. |
pandas/tests/test_arithmetic.py
Outdated
from pandas import Timedelta | ||
|
||
|
||
def assert_equal(left, right, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to utils.testing
pandas/tests/test_arithmetic.py
Outdated
raise NotImplementedError(type(left)) | ||
|
||
|
||
def box_expected(expected, box_cls): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe put in conftest.py, these are test helper functions that we don't necessarily want to publicly expose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, we should put this into _test_decorators (maybe rename though)
all for this! |
There are a ton of scattered arithmetic tests for Index/Series/DataFrame that should be testing the same things, but in fact are haphazard. Fixing this given the current structure would entail an enormous about of code duplication.
This PR if a proof of concept for gathering all those tests in one test_arithmetic.py file, parametrizing them, and ensuring that the relevant behavior is identical across arraylike classes.
As Datetime/Timedelta/Period EA come online, the case for de-duplication will be even stronger.
In this form it is really easy to track (via xfails) what behavior needs fixing.